package sz.szsmk.citizencard.ui.fragment;

import androidx.recyclerview.widget.LinearLayoutManager;

import sz.szsmk.citizencard.DaggerApplication;
import sz.szsmk.citizencard.R;
import sz.szsmk.citizencard.databinding.FragmentCouponOverdueBinding;
import sz.szsmk.citizencard.ioc.Compontent.DaggerCommonFragmentComponent;
import sz.szsmk.citizencard.model.network.bean.response.QueryNearStandbyRes;
import sz.szsmk.citizencard.mvp.contract.ICouponOverdueContact;
import sz.szsmk.citizencard.mvp.presenter.CouponOverduePresenter;
import sz.szsmk.citizencard.ui.adapter.BusSiteNearbyAdapter;
import sz.szsmk.citizencard.ui.base.IBaseFragment;

/**
 * Copyright (c)2018
 * author: zdh
 * created on: 2018/11/15 20:27
 * description:
 */
public class CouponOverdueFragment extends IBaseFragment <CouponOverduePresenter, FragmentCouponOverdueBinding>
implements ICouponOverdueContact.ICouponOverdueView {


//    private RecyclerView collecSiteRv;
    private BusSiteNearbyAdapter busSiteNearbyAdapter;

    public static CouponOverdueFragment getInstance() {
        CouponOverdueFragment sf = new CouponOverdueFragment();
        return sf;
    }


    @Override
    protected int attachLayoutRes() {
        return R.layout.fragment_coupon_overdue;
    }

    @Override
    protected void initInjector() {

        DaggerCommonFragmentComponent.builder().appCompontent(DaggerApplication.getAppComponent())
                .build().inject(this);
    }

    @Override
    protected void initViews() {

//        collecSiteRv = dataBinding.collecSiteRv;
        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getActivity());
//        dataBinding.collecSiteRv.setLayoutManager(linearLayoutManager);
//        busSiteNearbyAdapter = new BusSiteNearbyAdapter(getActivity());
//        dataBinding.collecSiteRvcollecSiteRv.setAdapter(busSiteNearbyAdapter);
//          dataBinding.swipeRefreshLayout;



//        dataBinding.collecSiteRv.setAdapter(busSiteNearbyAdapter);
//        dataBinding.collecSiteRv.setOnRefreshLoadLister(this);
//        dataBinding.collecSiteRv.startLoadFirst();


    }

    @Override
    protected void updateViews() {

    }

    @Override
    public void getDataListSucc(QueryNearStandbyRes response) {
//        busSiteNearbyAdapter.setViewData(response.getBusSiteList());
//        busSiteNearbyAdapter.notifyDataSetChanged();
//        dataBinding.collecSiteRv.onFinishRequest(false, false);
    }

    @Override
    public void getDataListFail() {

//        dataBinding.collecSiteRv.onFinishRequest(false, false);
    }


    @Override
    public void onResume() {
        super.onResume();
//        mPresenter.getDataList("string","string");
//        dataBinding.collecSiteRv.startLoadFirst();
    }
}
